import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/mes-warehouse/receiving/page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};
// 退货
export const returnReceiving = (data) => {
  return request({
    url: '/api/mes-warehouse/receiving/return',
    method: 'post',
    data
  });
};

export const getDetail = (id) => {
  return request({
    url: '/api/mes-warehouse/receiving/detail-list',
    method: 'get',
    params: {
      id
    }
  });
};

export const submitReceive = (data) => {
  return request({
    url: '/api/mes-warehouse/receiving/submit',
    method: 'post',
    data: data
  });
};

export const submitBatchReceive = (data) => {
  return request({
    url: '/api/mes-warehouse/receiving/impt/submit',
    method: 'post',
    data: data
  });
};

export const sendInspection = (row) => {
  return request({
    url: '/api/mes-warehouse/receiving/send-inspection',
    method: 'post',
    data: row
  });
};

export const cancelReceive = (ids) => {
  return request({
    url: '/api/mes-warehouse/receiving/undo',
    method: 'post',
    params: {
      ids
    }
  });
};
export const refactorSubmitReceive = (row) => {
  return request({
    url: '',
    method: 'post',
    data: row
  });
};

export const refatorGetList = (current, size, params) => {
  return request({
    url: '',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};

export const refactorRemove = (ids) => {
  return request({
    url: '',
    method: 'get',
    params: {
      ids
    }
  });
};
